PG-2398 PostgreSQL 16 support#587
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (76.27%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #587 +/- ##
==========================================
+ Coverage 56.08% 56.11% +0.02%
==========================================
Files 69 69
Lines 11051 11051
Branches 2738 2738
==========================================
+ Hits 6198 6201 +3
+ Misses 3515 3512 -3
Partials 1338 1338
🚀 New features to boost your workflow:
|
b9c536c to
32d5adc
Compare
6f03ce1 to
273cb2b
Compare
dutow
left a comment
There was a problem hiding this comment.
Generally looks good, some of my comments are about preexisting issues in our frontend code, so maybe those should be addressed in a separate PR.
Commit messages also have a few typos:
- sepfific
- JSOn
- PostgeSQL
- paritioned
- afor
| * pg_tde may exists and contain keys and providers for the WAL | ||
| * encryption | ||
| */ | ||
| if (strcmp(dirname, PG_TDE_DATA_DIR)) |
There was a problem hiding this comment.
isn't this condition inverted?
also, isn't dirname a full path?
There was a problem hiding this comment.
yes, that code looks very suspicious. But that is for another PR.
These is the raw PostgreSQL code copied using tools/copy_fetools.sh from REL_16_14.
This takes the diff we have for our patched PostgreSQL 17 tools and backports it to the PostgreSQL 16 tools. The commands below were ran to do this: git checkout REL_17_10 # In the PostgreSQL repo git checkout -b fetools_17_10 main rm -r fetools/pg17 tools/copy_fetools.sh path/to/pg 17 git add fetools/pg17 git commit -m REL_17_10 git checkout pg16 git diff fetools_17_10 main --relative=fetools/pg17 | git apply -3 --directory=fetools/pg16 The conflicts needed to be solved were minor.
Since we will need more frontend sepcific code to support PostgreSQL 16, namely the error handling for the JSON parser, we may as well clean up the pg_tde_fe.c and create a proper C file which we can compile and link to.
The changes needed to make pg_tde compile and run against PostgreSQL 16 are: - Support older API for the JSON parser - Add a copy of the JSON error message code which can be used by the frontend code. - Backport helper function get_rel_relam() - Backport foreach_oid() helper macro - Add non-vectorized read and write to the TDE SMGR - Include unistd.h where necessary
Apparently PostgreSQL 17 moved some output from stdout to stderr.
Before PostgreSQL 17 pg_rewind did not support in-place tablesapces so we should just skip those tests on PostgreSQL 16.
Before PostgreSQL 17 the default table access method only mattered when creating tables, and was not relevant when running ALTER TABLE so there was no SET ACCESS METHOD DEFAULT. While doing this we also remove the unnecessary DROP TABLE commands, which would have added more conditionals on the version, since we already test DROP TABLE in other places and we remove the whole cluster anyway. It is a bit unclear if these test case should even exist in the first place as we also test this in our pg_regress tests. The pg_regress tests will be fixed to support PostgreSQL 16 in a later commit.
…ess method Before PostgreSQL 17 the default table access method only mattered when creating tables, and was not relevant when running ALTER TABLE so there was no SET ACCESS METHOD DEFAULT.
…d tables Before PostgreSQL 17 it was not possible to set the access method on paritioned tables.
|
I can fix the preexisting typos and the potential preexisting bug in a separate PR. |
Most of the work doing this was related to making everything build without injection points as injection points were first added in PostgreSQL 17.
dutow
left a comment
There was a problem hiding this comment.
I can fix the preexisting typos and the potential preexisting bug in a separate PR.
Yes, that makes sense, it was just easier to add them as comments to this PR.
This adds support for PostgreSQL 16.
Questions